This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
disk index: store ref_count in data file #30974
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
See #30711
Top line is master now.
On the right graph, the drop in the blue line is the index file shrinking thanks to index entry no longer containing u64 refcount.
The left graph is total data file size. The very bottom line is the change that stores slotlist=1 elements in the index file (4MB). The line just above it is THIS change, which adds a u64 per element so we can store ref_count. Not sure why we have a handful of data files. 6MB total allocated now when it used to be 4MB.
Note that both scales are log.
The very bottom line on the right graph is a test validator that increases the search length, thus, reducing the # of over-allocations we attempt.
These compound, so with that change, we’d be in the mid 20GB for the entire index basically.
Beats 74GB or whatever the previous impl was at.
Summary of Changes
When ref_count != 1, store ref_count per element in the data file. This means the 99.9% case of ref_count=1 does not have to be stored per allocated element.
Fixes #